<!DOCTYPE html>
<html style="background-color: #F2F2F2;">
<head>
	
	<title><?php echo _MANAGER_TITLE_; ?></title>

	<?php $this->setFlag('list,vue'); ?>
	<?php $this->import('meta'); ?>

	<link rel="stylesheet" type="text/css" href="html/console/housecraft/css/list.css" />

    <script type="text/javascript" src="html/console/housecraft/js/list.js?v=12"></script>

</head>
<body>

	<div style="display: none;"></div>
	<div id="loadSpin" class="bg"></div>

	<div id="mainBg" class="bg" style="display: none;">

		<input type="text" id="statusInfo" class="display-none" value="1" />
		<input type="text" id="sortationInfo" class="display-none" />
		<input type="text" id="tempid" class="display-none" />
        <input type="text" id="menuid" class="display-none" />

        <div class="condition-bar">
			<div class="option-bar">
				<div class="option-item" onclick="showOption('1')">
                    <span id="optionItemText1" class="option-item-text">展示中</span>
                    <span><img id="optionItemimg1" src="static/pic/app/option_down.png" class="option-item-img" /></span>
                </div>
                <div class="option-item" onclick="showOption('2')">
                    <span id="optionItemText2" class="option-item-text">分类</span>
                    <span><img id="optionItemimg2" src="static/pic/app/option_down.png" class="option-item-img" /></span>
                </div>
			</div>
		</div>
		<div class="condition-empty-area"></div>

		<div class="count-bar">
			共 <span id="listCount" class="count-color">X</span> 条信息
		</div>

		<div id="listBar">
			<div v-bind:id="'housecraftInfo' + info.housecraftid" v-for="info in list">
				<div class="list-bar" v-on:click="viewHousecraft(info.housecraftid)">
        			<div class="list-title">{{ info.title }}</div>
        			<div class="list-remark">
        				<div class="list-remark-left">
        					栏目分类：<template v-if="info.sortation == 0">月嫂保姆</template>
	                        <template v-else-if="info.sortation == 1">清洗保洁</template>
	                        <template v-else-if="info.sortation == 2">家居清洗</template>
	                        <template v-else>--</template>
        				</div>
        			</div>
                    <div class="list-remark2">
                        <div class="list-remark-left">服务特征：{{ info.feature == '' ? '--' : info.feature }}</div>
                    </div>
                    <div class="list-remark2">
                        <div class="list-remark-left">服务范围：{{ info.area == '' ? '--' : info.area }}</div>
                    </div>
                    <div class="list-remark2">
                        <div class="list-remark-left">访问统计：{{ info.click }}次点击，{{ info.dial }}次电话</div>
                    </div>
                    <div class="list-remark2">
                        <div class="list-remark-left">
                        	剩余天数：展示/<template v-if="info.expiretime != '永久'"><template v-if="info.showResidueDays <= 7"><span class="tc1">{{ info.showResidueDays }}</span></template>
	                        <template v-else>{{ info.showResidueDays }}</template>天</template><template v-else>永久</template>
	                        <template v-if="info.istop == 1">
	                            ，置顶/<template v-if="info.topResidueDays <= 7"><span class="tc1">{{ info.topResidueDays }}</span></template>
	                            <template v-else>{{ info.topResidueDays }}</template>天
	                        </template>
                        </div>
                    </div>
                    <div class="list-remark2">
                        <div class="list-remark-left">
                        	信息状态：<template v-if="info.status == 0"><span class="tc1">待审核</span></template>
	                        <template v-else-if="info.status == 1"><span class="tc2">展示中</span></template>
	                        <template v-else-if="info.status == 2"><span class="tc3">下架</span></template>
	                        <template v-else-if="info.status == 3"><span class="tc3">回收</span></template>
	                        <template v-else-if="info.status == 4"><span class="tc3">已过期</span></template>
	                        <template v-else-if="info.status == 5"><span class="tc3">已退款</span></template>
	                        <template v-else>--</template>
                        </div>
                    </div>
        		</div>
        		<template v-if="info.status != 4 && info.status != 5">
        			<div class="list-tool">
	        			<div class="list-tool-left"></div>
	        			<template v-if="info.status == 0">
                            <template v-if="permission.setstatus == 'yes'">
                                <div class="list-tool-btn" v-on:click="putHousecraft(info.housecraftid)">发布</div>
                                <div class="list-tool-btn2" v-on:click="retrieveHousecraft(info.housecraftid)">回收</div>
                            </template>
	                    </template>
	                    <template v-else-if="info.status == 1">
                            <template v-if="permission.setstatus == 'yes'">
                                <div class="list-tool-btn2" v-on:click="pullHousecraft(info.housecraftid)">下架</div>
                            </template>
	                    </template>
	                    <template v-else-if="info.status == 2">
                            <template v-if="permission.setstatus == 'yes'">
                                <div class="list-tool-btn" v-on:click="putHousecraft(info.housecraftid)">上架</div>
                            </template>
	                    </template>
	                    <template v-else-if="info.status == 3">
                            <template v-if="permission.setstatus == 'yes'">
                                <div class="list-tool-btn" v-on:click="restoreHousecraft(info.housecraftid)">恢复</div>
                            </template>
	                    </template>
                        <template v-if="permission.editinfo == 'yes'">
                            <template v-if="info.status == 1">
                                <div class="list-tool-btn2" v-on:click="pushToTweet(info.housecraftid, info.title)">微信推送</div>
                            </template>
                        </template>
                        <template v-if="permission.viewlog == 'yes'">
                            <div class="list-tool-btn2" v-on:click="viewLog(info.housecraftid)">日志记录</div>
                        </template>
	        		</div>
        		</template>
				<div class="list-separate"></div>
			</div>
		</div>

		<?php $this->import('page'); ?>
		<?php $this->import('totop'); ?>
		<?php $this->import('slipoption'); ?>
		<?php $this->import('slipiframe'); ?>
        <?php $this->import('slipmore'); ?>



		<div id="optionItemFloatDiv1" class="option-item-float-div1" style="display: none;">
        	<div class="select-item" onclick="selectOption(this, '1', 'statusInfo', '展示中')">
                <div class="select-text-click">展示中</div>
                <img class="select-img" src="static/pic/app/option_click.png" />
            </div>
        	<div class="select-item" onclick="selectOption(this, '0', 'statusInfo', '待审核')">
                <div class="select-text">待审核</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
            <div class="select-item" onclick="selectOption(this, '2', 'statusInfo', '下架')">
                <div class="select-text">下架</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
            <div class="select-item" onclick="selectOption(this, '3', 'statusInfo', '回收')">
                <div class="select-text">回收</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
            <div class="select-item" onclick="selectOption(this, '4', 'statusInfo', '已过期')">
                <div class="select-text">已过期</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
            <div class="select-item" onclick="selectOption(this, '5', 'statusInfo', '已退款')">
                <div class="select-text">已退款</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
        </div>

        <div id="optionItemFloatDiv2" class="option-item-float-div2" style="display: none;">
        	<div class="select-item" onclick="selectOption(this, '', 'sortationInfo', '分类')">
                <div class="select-text-click">全部</div>
                <img class="select-img" src="static/pic/app/option_click.png" />
            </div>
        	<div class="select-item" onclick="selectOption(this, '0', 'sortationInfo', '月嫂保姆')">
                <div class="select-text">月嫂保姆</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
            <div class="select-item" onclick="selectOption(this, '1', 'sortationInfo', '清洗保洁')">
                <div class="select-text">清洗保洁</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
            <div class="select-item" onclick="selectOption(this, '2', 'sortationInfo', '家居清洗')">
                <div class="select-text">家居清洗</div>
                <img class="select-img" src="static/pic/app/option_click.png" style="display: none;" />
            </div>
        </div>

        <div id="slipMoreBtnBar" style="display: none;">
            <div class="slipmore-option-title">信息操作</div>
            <div>
                <div id="addInfoBtn" class="slipmore-option-btn1" onclick="addHousecraft()">添加新信息</div>
            </div>
        </div>

        <script type="text/javascript">
            var housecraft = new Vue({
                el: '#listBar',
                data: {
                    list: '',
	                permission: ''
                }
            });
        </script>

	</div>

</body>
</html>